﻿@using Masuit.Tools
@using Microsoft.Net.Http.Headers

@{
    Layout = null;
}
<!DOCTYPE html>
<html>
<head>
    <title>访问被拒绝！</title>
    <style type="text/css">
        #main-scrollbar {
            position: fixed;
            top: 0;
            right: 0;
            bottom: 0;
            left: 0;
        }

        .STYLE1 {
            font-family: Arial, Helvetica, sans-serif;
            font-size: 65px;
        }

        body {
            background-image: url(/images/bg2.jpg);
            background-size: cover;
            background-position: 50% 0;
            margin: 0;
        }

            body:before {
                content: '';
                display: inline-block;
                vertical-align: middle;
            }
    </style>
    <meta property="qc:admins" content="153016004160513163145" />
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <link href="https://cdn.staticfile.org/smooth-scrollbar/7.4.1/smooth-scrollbar.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/limonte-sweetalert2/8.11.8/sweetalert2.min.css" rel="stylesheet">
    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
    <script src="https://cdn.staticfile.org/jquery/3.4.1/jquery.min.js"></script>
    <script src="https://cdn.staticfile.org/jquery.ripples/0.5.3/jquery.ripples.min.js"></script>
    <script src="https://cdn.staticfile.org/smooth-scrollbar/7.4.1/smooth-scrollbar.js"></script>
    <script src="https://cdn.staticfile.org/limonte-sweetalert2/8.11.8/sweetalert2.min.js"></script>
</head>
<body id="main-scrollbar" data-scrollbar>
    <div class="container">
        <header id="header" class="page-header text-center">
            <h1>Oops!</h1>
        </header>
        <div id="container">
            <h3 class="margintop20">
                <em>
                    <span class="STYLE1">Sorry!访问被拒绝&nbsp;</span>
                </em>
            </h3>
            <h4>您所在的地区暂时不允许访问本站，如有疑问，请联系站长！或者请联系站长开通本站的访问权限！</h4>
            <form action="/" method="post" class="form-inline" id="code-token">
                @Html.AntiForgeryToken()
                <div class="input-group">
                    <span class="input-group-addon">邮箱：</span>
                    <input type="email" name="Email" id="email3" class="form-control" />
                    <span class="input-group-btn">
                        <button type="button" class="btn btn-info getcode">获取通行证</button>
                    </span>
                </div>
                <div class="input-group">
                    <span class="input-group-addon">验证码：</span>
                    <input type="text" name="token" id="token" class="form-control" />
                    <span class="input-group-btn">
                        <button type="submit" class="btn btn-info">检查通行证</button>
                    </span>
                </div>
            </form>
        </div>
    </div>
</body>
</html>
<script>
    $(document).ready(function () {
        Scrollbar.initAll({
            speed: 3,
            overscrollEffect: 'bounce',
            overscrollEffectColor: '#d2527f'
        });
        try {
            $('body').ripples({
                resolution: 512,
                dropRadius: 20, //px
                perturbance: 0.04,
            });
        }
        catch (e) {
            $('.error').show().text(e);
        }
    });
</script>
<script>
    $("#code-token").on("submit", function (e) {
        e.preventDefault();
        $.post("/error/CheckViewToken", $(this).serialize(), function (data) {
            if (data.Success) {
                window.location.href = "/";
            } else {
                Swal.fire({
                    type: 'error',
                    title: data.Message,
                    showConfirmButton: false,
                    timer: 5000
                });
            }
        });
    });
    $(".getcode").on("click", function (e) {
        e.preventDefault();
        $.post("/error/getviewtoken",
            {
                __RequestVerificationToken: $("[name=__RequestVerificationToken]").val(),
                email: $("#email3").val()
            }, function (data) {
                if (data.Success) {
                    Swal.fire({
                        type: 'success',
                        title: "验证码发送成功，请注意查收邮件，若未收到，请检查你的邮箱地址或邮件垃圾箱！",
                        showConfirmButton: false,
                        timer: 1500
                    });
                    window.localStorage.setItem("email", $("#email3").val());
                    $(".getcode").attr('disabled', true);
                    var count = 0;
                    var timer = setInterval(function () {
                        count++;
                        $(".getcode").text('重新发送(' + (120 - count) + ')');
                        if (count > 120) {
                            clearInterval(timer);
                            $(".getcode").attr('disabled', false);
                            $(".getcode").text('重新发送');
                        }
                    }, 1000);
                } else {
                    Swal.fire({
                        type: 'error',
                        title: data.Message,
                        showConfirmButton: true,
                        confirmButtonText: "确定"
                    });
                }
            });
    });
</script>
@{
    if (Context.Request.Headers[HeaderNames.UserAgent].ToString().Contains(new[] { "IE", "InternetExplorer" }))
    {
        <script type="text/javascript">
            notie.confirm("亲爱的访客，我们检测到您正在使用IE浏览器，本网站的某些功能或特性可能不会完美地支持IE浏览器，但您可以继续浏览，不过为了更好的体验效果，建议您使用Chrome、Firefox等相同或类似的更高级浏览器访问本网站。珍惜生命，远离IE！", '朕知道了', "挡住我了", function () {
                notie.alert(1, '为消灭IE做一点贡献，就是为世界上所有广大的互联网开发者们少加一点儿班做善事！<br/>IE：只要不升级，我还会回来的，我就是这么倔强！', 5);
            });
        </script>
    }
}